import fasttext
import sys


if __name__ == '__main__':
    train_data = sys.argv[1]
    out_model = sys.argv[2]
    test_data = sys.argv[3]
    model = fasttext.supervised(train_data, out_model, epoch=25, label_prefix='__label__', dim=100, word_ngrams=1, bucket=2000000, thread=6)
    result = model.test(test_data)

    print(model.labels)
    print(len(model.labels))
    print(result.precision)
    print(result.recall)

